#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <string.h>
#include "Arduino.h"

void task_function(void *pvParameter) {
    uint8_t CPU_RunInfo[400];
 
    while (1) {
        memset(CPU_RunInfo, 0, 400);
        vTaskList((char *)&CPU_RunInfo);
 
        printf("----------------------------------------------------\r\n");
        printf("task_name   status   priority   stack   num   core\r\n");
        printf("%s", CPU_RunInfo);
        printf("----------------------------------------------------\r\n");
 
        vTaskDelay(500 / portTICK_PERIOD_MS);
    }
}

void setup(void)
{
    xTaskCreate(task_function, "task", 4096, NULL, 1, NULL);
    vTaskDelete(NULL);
}


void loop()
{
  delay(1000);
}